import request from '@/utils/request'

/**
 * 获取反馈列表
 * @param {Object} params 查询参数
 * @returns Promise
 */
export function getFeedbackList(params) {
  return request({
    url: '/api/feedback/list',
    method: 'get',
    params: {
      pageNum: params.pageNum,
      pageSize: params.pageSize,
      timeRange: params.timeRange,
      status: params.status,
      feedbackType: params.feedbackType,
      searchType: params.searchType,
      keyword: params.keyword
    }
  })
}

/**
 * 删除反馈
 * @param {String} id 反馈ID
 * @returns Promise
 */
export function deleteFeedback(id) {
  return request({
    url: `/api/feedback/${id}`,
    method: 'delete'
  })
}

/**
 * 刷新反馈列表
 * @returns Promise
 */
export function refreshFeedbackList() {
  return request({
    url: '/api/feedback/refresh',
    method: 'get'
  })
}